<?php
/**
 * 商城板块初始化文件
 *
 *
 *
 * @网店运维提供技术支持 授权请购买shopnc授权
 * @license    http://www.shopwwi.com
 * @link       交流群号：111731672
 */
define('APP_ID','shop');
define('BASE_PATH',str_replace('\\','/',dirname(__FILE__)));

require __DIR__ . '/../shopwwi.php';
$wapurl = APP_SITE_URL;
$agent = $_SERVER['HTTP_USER_AGENT'];

$is_mobile = false;
if(strpos($agent,"comFront") || strpos($agent,"iPhone") || strpos($agent,"MIDP-2.0") || strpos($agent,"Opera Mini") || strpos($agent,"UCWEB") || strpos($agent,"Android") || strpos($agent,"Windows CE") || strpos($agent,"SymbianOS")){
    $is_mobile = true;
}

if(strpos($_SERVER['HTTP_ACCEPT'],"json")){
    $is_mobile = false;
}

if($is_mobile){
    header("Location:$wapurl");
}


define('APP_SITE_URL',SHOP_SITE_URL);
define('TPL_NAME',TPL_SHOP_NAME);

define('BASE_TPL_PATH',BASE_PATH.'/templates/'.TPL_NAME);

//var_dump(SHOP_TEMPLATES_URL);
//var_dump(BASE_SITE_URL);
if (!@include(BASE_PATH.'/control/control.php')) exit('control.php isn\'t exists!');
header("Content-type:text/html;charset=utf-8");  //utf8
Base::run();

